<template>
	<view class="index-section">
		<tit tit="基础知识" url="/pages/home/dietIndex" />
		<view class="line"></view>
		<view class="main">
			<contentsInfo :list="dataList" :isAddress="true" :url="'/pages/home/festivalDetail'" metType="1"/>
			<view style="width: 100%; text-align: center; font-size: 28rpx; margin-top: 10rpx;">{{isText}}</view>
		</view>
	</view>
</template>

<script>
	import tit from '@/pages/index/cpns/title.vue';
	import contentsInfo from '@/pages/index/cpns/contentsInfo.vue';
	import {
		knowList
	} from "@/request/homeApi.js"

	export default {
		components: {
			tit,
			contentsInfo
		},
		data() {
			return {
				dataList: [],
				isText: ''
			};
		},
		mounted() {
			// this.getList()
		},
		methods: {
			getList() {
				let that = this
				knowList({
					category_id: '',
					page: 1,
					limit: 2,
					title: '',
					is_top: 2
				}).then(res => {
					if (res.code == 200) {
						that.dataList = res.data.list
						res.data.count == 0 ? that.isText = '暂无' : that.isText = ''
					} else {
						uni.showToast({
							title: res.msg,
							duration: 1500,
							icon: 'none',
						})
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.index-section {
		padding: 20rpx;
		margin-top: 20rpx;
		background-color: #fff;

		.line {
			height: 2rpx;
			width: 100%;
			background-color: #DADADA;
			margin: 20rpx 0;
		}

	}
</style>